import org.apache.log4j.xml.DOMConfigurator;

import com.ricky.config.ConfigLoader;
import com.ricky.db.DBHelper;
import com.ricky.net.GameServer;
import com.ricky.net.Policy;


/***
 *	Start.java</br>
 *	@author pu
 *  @Data 2011-11-1</br>
 *	@version v0.1</br>
 *	@Discription 
 ***/
public class Start {

	private GameServer gameServer;
	private Policy policy;
	
	public void run()
	{
		try {
			
			DOMConfigurator.configure(System.getProperty("user.dir")+"/config/game/log4j.xml");

			ConfigLoader.load();
			
			DBHelper.init();
			
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (SecurityException e) {
			e.printStackTrace();
		}
		
		gameServer=new GameServer();
		gameServer.init();
		gameServer.start();
		
		policy=new Policy(843);
		policy.init();
		policy.start();
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Start s=new Start();
		s.run();
	}

}
